import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';

export type AccountParams = BasicPageParams & {
  nickname?: string;
  username?: string;
  realName?: string;
  email?: string;
  roles?: Array<number>;
  createTime?: string;
  remark?: string;
  status?: boolean;
  userId: number;
  deptId: number;
};

export type RoleParams = {
  name?: string;
  enName?: string;
  id?: number;
  orderNo?: number;
  remark?: string;
  status?: boolean;
  //部门id
  deptIds?: Array<number>;
  //菜单资源id
  menuIds?: Array<number>;
  // 接口资源id
  itfIds?: Array<number>;
};

export type RolePageParams = BasicPageParams & RoleParams;

export type InterfacePageParams = BasicPageParams & InterfaceParams;

export type InterfaceParams = {
  categoryId?: number;
  name?: number;
  path?: string;
  type?: string;
  sort?: number;
  status?: boolean;
  remark?: string;
  id?: number;
};

export type InterfaceCateParams = {
  id?: number;
  name?: string;
  sort?: number;
  description?: string;
  updateTime?: string;
  createTime?: string;
};

export type DeptParams = {
  id?: number;
  name?: string;
  orderNo?: number;
  remark?: string;
  status?: boolean;
  parentId?: number;
};

export type MenuParams = {
  menuName?: string;
  status?: string;
  id?: number;
  parentId?: number;
  name?: string;
  path?: string;
  component?: string;
  description?: string;
  level?: number;
  redirect?: string;
  caseSensitive?: boolean;
  isExt?: string;
  metaId?: number;
  permission?: string;
  menuType?: string;
  title?: string;
  ignoreRoute?: boolean;
  orderNo?: string;
  hideMenu?: boolean;
  hideTab?: boolean;
  currentActiveMenu?: string;
  hideChildrenInMenu?: boolean;
  carryParam?: boolean;
  hideBreadcrumb?: boolean;
  transitionName?: string;
  frameSrc?: string;
  icon?: string;
  affix?: boolean;
  ignoreKeepAlive?: boolean;
};

export interface AccountListItem {
  id: number;
  username: string;
  realName: string;
  email: string;
  nickname: string;
  roles: Array<number>;
  createTime: string;
  remark: string;
  status: boolean;
  userId: number;
}

export interface DeptListItem {
  id: number;
  orderNo: string;
  createTime: string;
  remark: string;
  status: number;
}

export interface MenuListItem {
  id: number;
  orderNo: string;
  createTime: string;
  status: number;
  icon: string;
  component: string;
  permission: string;
}

export interface RoleListItem {
  id: number;
  name: string;
  enName: string;
  status: boolean;
  deptId: number;
  orderNo: number;
  createTime: string;
  remark: string;
}

export type InterfaceListItem = {
  categoryId: number;
  name: string;
  path: string;
  type: string;
  sort: number;
  status: boolean;
  remark: string;
  id: number;
  createTime: string;
};

export type InterfaceCateListItem = {
  id: number;
  name: string;
  sort: number;
  description: string;
  updateTime: string;
  createTime: string;
};

/**
 * @description: Request list return value
 */
export type AccountListGetResultModel = BasicFetchResult<AccountListItem>;

export type DeptListGetResultModel = BasicFetchResult<DeptListItem>;

export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;

export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;

export type InterfacePageListGetResultModel = BasicFetchResult<InterfaceListItem>;

export type RoleListGetResultModel = RoleListItem[];

export type InterfaceListGetResultModel = InterfaceListItem[];

export type InterfaceCateListGetResultModel = InterfaceCateListItem[];

export type InterfaceCatePageListGetResultModel = BasicFetchResult<InterfaceCateListItem>;
